Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

program: dynamic liquidation fee for liq_perp_with_fill #1185

Merged
merged 13 commits into from
Aug 21, 2024

Conversation

NourAlharithi
Copy link
Member

No description provided.

programs/drift/src/math/liquidation.rs Outdated Show resolved Hide resolved
programs/drift/src/math/liquidation.rs Outdated Show resolved Hide resolved
pub struct SetUserStatusToBeingLiquidated<'info> {
pub state: Box<Account<'info, State>>,
#[account(mut)]
pub user: AccountLoader<'info, User>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to add a signer here as well, i think anchor client is probably just adding it by default on the client side

@@ -969,13 +967,28 @@ pub fn liquidate_perp_with_fill(
)?;

let existing_direction = user.perp_positions[position_index].get_direction();
let max_liquidation_fee =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. should use safe_math
  2. should prob just call get_ref once and then drop it

could potentially also just make this a method on the perp market account?

@crispheaney crispheaney merged commit 6bfadc8 into master Aug 21, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants